package com.design.pattern.factory.simple;

/**
 * Created by Lxk on 2019/9/28.
 */
public class FactoryTest {

    public static void withoutSimpleFactory() {
        System.out.println("=========== use factory ==========");
        Car c = new Audi();
        Car c2 = new Byd();

        c.run();
        c2.run();
    }

    public static void withSimpleFactory() {
        System.out.println("=========== use simple factory ==========");
        Car c = CarFactory.createCar("Audi");
        Car c2 = CarFactory.createCar("Byd");

        c.run();
        c2.run();
    }

    public static void main(String[] args) {
        withoutSimpleFactory();
        withSimpleFactory();
    }

}
